
<!--
/**************************************************
* @ balancecategorymanage.jsp
*
* Copyright   2005 Hitrust Technology Inc.
* Developed by SDC, Hitrust.
* All Rights Reserved.
*
* Modify History:
*  v1.00, 2006/12/01, simoni peng
*  1) first release
/**************************************************
-->
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ include file="../../common.jsp" %>
<%@ taglib uri="/page.util.gs.hitrust.com/taglibs/page" prefix="page"%>

<html>
<head>
<title>结算分类</title>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<!--<LINK href="<%=root%>/css/css.css" type=text/css rel=stylesheet>-->
<LINK href="<%=root%>/css/caigouxitong.css"" type=text/css rel=stylesheet>
<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
<%
	String tReQuery = (String)request.getAttribute("requery");
%>
<script>
	var counter;
	function process(param){
		 if(param == 'Q'){
			operatorviewform.action = "<%= response.encodeURL(request.getContextPath() + "/A401302.do") %>";
            document.all.querymode.value='Q';
            operatorviewform.submit();
    	
		}
		if(param=='QP'){
			if(operatorviewform.operOrgId.options.length == 1){
				if(operatorviewform.operOrgId.options[i].selected && operatorviewform.operOrgId.options[i].value =='00'){		
					return false;
				}
			}
			if(operatorviewform.operId.options.length == 1){
				if(operatorviewform.operId.options.selected && operatorviewform.operId.options.value =='00'){		
					return false;
				}
			}
			if(operatorviewform.operName.options.length == 1){
				if(operatorviewform.operName.options.selected && operatorviewform.operName.options.value =='00'){		
					return false;
				}
			}
			operatorviewform.action = "<%=response.encodeURL(root+"/A401302.do")%>";
			document.all.querymode.value='QP';
			operatorviewform.submit();					
		}
	}
	function add(){
       var result = null;	
		result = showModalDialog("<%= response.encodeURL(request.getContextPath() + "/A401304.do") %>", window,"status:no;unadorned:no;dialogWidth:900px;dialogHeight:600px;help:no;");
		if(result != null){
			balancecategoryform.balanceCategoryName.value = result[0]; 
	       	balancecategoryform.desc.value = result[1];
			balancecategoryform.action="<%= response.encodeURL(request.getContextPath() + "/A401307.do") %>";
			balancecategoryform.submit();
		}
    return true;
}
	
	function del(param){
		if (confirm("是否删除此结算分类信息？")) {
			balancecategoryform.balanceCategoryNo.value=param;
			balancecategoryform.action='<%= response.encodeURL(request.getContextPath() + "/A401306.do") %>';
			balancecategoryform.submit();
		}
	}
	
	function mod(param){
		balancecategoryform.balanceCategoryNo.value=param;
        var result = null;	
		result = showModalDialog("<%= response.encodeURL(request.getContextPath() + "/A401305.do") %>?balanceCategoryNo="+balancecategoryform.balanceCategoryNo.value, window,"status:no;unadorned:no;dialogWidth:900px;dialogHeight:600px;help:no;");
		if(result != null){
	       	balancecategoryform.balanceCategoryName.value = result[0];
	       	balancecategoryform.desc.value = result[1];
			balancecategoryform.action="<%= response.encodeURL(request.getContextPath() + "/A401308.do") %>";
			balancecategoryform.submit();
			
		}
	}


	function init(parma){
		<%
		    if(tReQuery!=null && tReQuery.equals("true")){
		%>

	        if(parma == 'Q'){    
				document.all.querymode.value='Q';	        	
			}else if(param == 'QP'){
				document.all.querymode.value='QP';	        	
			}
			operatorviewform.action = "<%= response.encodeURL(request.getContextPath() + "/A401302.do") %>";			
	        operatorviewform.submit();	
	                
	   	<%}%>		
	}
	
	function clean(){

		operatorviewform.balanceCategoryName.value ="";
		operatorviewform.desc.value ="";	
    }	
</script>
</head>
<%
	String querymode = (String)request.getAttribute("querymode");
	ArrayList tList = (ArrayList)request.getAttribute("balancecategory");
%>
<script language="javascript">
</script>
<body text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="init('<%=querymode%>')">
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td height="20"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr height="20">
          <td height="20" width="1" class="mtxt_black">&nbsp;</td>
          <td height="30" width="758" class="mtxt_black">结算分类管理</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bg_line" height="2"></td>
  </tr>
</table>
<form name="operatorviewform" method="get" >
<input type='hidden' name='querymode' value="<%=request.getAttribute("querymode")%>">
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr> 
		<td> 
			<table class=bg_table id=tableId	cellspacing=1 cellpadding=0 style="padding-left:5;padding-right:5" width=100% align=center border=0>
				<TR height=20>
					<TD class="bg_column" align=center>结算分类名称</TD>
					<TD left=right class="bg_row_odd">
						<input type="text" name="balanceCategoryName" maxlength="500" value="<%=request.getAttribute("balanceCategoryName") == null? "":request.getAttribute("balanceCategoryName")%>">					
					</TD>				
					<TD class="bg_column" align=center>描述</TD>
					<TD align=left class="bg_row_odd">
						<input type="text" name="desc" maxlength="500" value="<%=request.getAttribute("desc") == null? "":request.getAttribute("desc")%>">					
					
					</TD>								
				</TR>
			</table>
		</td>
	</tr>
</table>
</form>
    <p align="center">  
<!--		<input type="image" src="images/button/chaxun.gif" width="58" height="24" class="box" onclick="process('Q')"/>&nbsp;-->
	<input type="button" class="kuang" onClick="process('Q')" value="查询">&nbsp;
	<input type="button" class="kuang" onClick="clean()" value="清空">&nbsp;

    </p>
<%
	
	if(tList != null && "Q".equals(querymode)){
%>
	<center>

    <table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
		<tr>
			<td>

            <input type="hidden" name="operId2" value="">
            	<table class=bg_table id=tableId	cellspacing=1 cellpadding=2 width=100% align=center border=0>
                    <tbody> 
                    <tr class="bg_column" height=20> 
                        <td class=top align=middle width='10%'> 
                        </td>
                        <td class=top align=middle width='10%'>  
                        </td>
                        <td class=top align=middle width='30%'> 
                        <div align="center" class="txt_content">结算分类名称</div>
						</td>
                        <td class=top align=middle width='50%'> 
                        <div align="center" class="txt_content">描述</div>
						</td>
					</tr>
					<%
						if(tList != null && tList.size() > 0){
						for(int i=0; i<tList.size(); i++)
						{
							GSBalanceCategoryBean tBean = (GSBalanceCategoryBean)tList.get(i);
							boolean bSystem = tBean.getGs_balance_category_no().equalsIgnoreCase("0");
							String tTempStr="";
							if(i%2==0){
								tTempStr="class=\"bg_row_odd\"";
							}else {
								tTempStr="class=\"bg_row_even\"";
							}
					%>
							<tr <%=tTempStr%> height=20>
		                         <td class=top align=middle> 
		                         <%
		                         	if(!bSystem)
		                         	{
		                         %>
		                         		<div align="center" class="box">
			                            <input type="button" value="修改" onClick="mod('<%=tBean.getGs_balance_category_no()%>');" class="kuang">
		                            </div>
		                         <%	
		                         	}
		                         %>	
		                        </td>
		                        <td class=top align=middle> 
		                        <%
		                         	if(!bSystem)
		                         	{
		                         %>
		                         	  <div align="center" class="box">
			                            <input type="button" value="删除" onClick="del('<%=tBean.getGs_balance_category_no()%>');" class="kuang">
		                            </div>
		                         <%	
		                         	}
		                         %>	
		                         
		                        
		                        </td>								
		                        <td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tBean.getGs_balance_category_name()%>
									</div>
								</td>	
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tBean.getGs_desc()==null?"":tBean.getGs_desc()%>
									</div>
								</td>								
							</tr> 
							
					<%	
							}
					%>

				    <%
						}else{
					%>
							<font color="red">没有符合条件的结算分类</font>
					<%
						}
					%>
					</tbody>
				</table>

			</td>
		</tr>	
	</table>
	<p>
		<table>
			<tr>
			<td class=top align=middle> 
				<div align="center" class="txt_content">
				<input type="button" class="kuang" value="增加" onclick="add()"/>
				</div>
			</td>
			</tr>
		</table>
	</p>		
<%		
	}
%>

<%		

	if(tList == null && tReQuery != null && tReQuery.equals("true")){
%>
	<font size="2">数据查询中......</font>
<%	    
	}
%>
	</center>	
<form name="operateform" method="post">
	<input type="hidden" name="balanceCategoryNo" >
	<input type="hidden" name="balanceCategoryName" >
	<input type="hidden" name="desc" >
</form>
<form name="balancecategoryform" method="post">
	<input type="hidden" name="balanceCategoryNo" >
	<input type="hidden" name="balanceCategoryName" >
	<input type="hidden" name="desc" >
</form>

</body>
<script language='javascript'>
	function updatepwd(index,tmpid,tmpvalue){

		document.getElementById("pwd"+index).innerHTML = "<input type='text' id=pwdinput"+index+" value='"+tmpvalue+"'><input type='button' value='再输一次' onclick=reinputpwd('pwdinput"+index+"','"+tmpid+"')>";
	
	}
	
	function reinputpwd(val1,val2){
	
		var newpwd = document.getElementById(val1).value;
		var url="<%= response.encodeURL(request.getContextPath() + "/A400510.do") %>?operid="+val2+"&pwd="+newpwd;
		window.open(url,null," edge: sunken ; center: Yes; help: No; resizable: Yes; status: No; width: 200px ; height: 100px ; scroll:yes");		
		
	}
</script>


</html>